package normalclass;

public class Demo02 {
    public static void main(String[] args) {
        Worker worker = method01();
        System.out.println(worker.name);//乔峰

        Person p = method02();
        System.out.println(p.name);//null

        Worker worker2 = method03(worker);
        System.out.println(worker2.name);//段誉
    }

    public static Worker method01() {
        Worker w = new Worker();
        w.name = "乔峰";
        return w;
    }

    public static Person method02() {
        return new Worker();
    }

    public static Worker method03(Worker w) {
        w.name = "段誉";
        return w;
    }
}
